from selenium import webdriver
import pytest

@pytest.fixture() #默认类中方法级夹具
def get_driver():
    # driver =  webdriver.Edge()
    # driver.maximize_window()
    # yield driver
    # driver.quit()
    #无头浏览器
    options = webdriver.EdgeOptions()
    options.add_argument("--headless")
    options.add_argument("--no-sandbox")
    options.add_argument("--disable-gpu")
    driver = webdriver.Edge(options=options)
    driver.maximize_window()
    yield driver
    driver.quit()
